package com.wudgaby.study.jwtauth.servlet;

import com.wudgaby.study.jwtauth.support.RedisSupport;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter(description = "认证过滤", filterName = "authFilter", urlPatterns = {"/**"})
@Slf4j
//@Component
public class AuthFilter implements Filter {
    @Autowired
    private RedisSupport redisSupport;

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        log.info("redisSupport : {}", redisSupport);
    }

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void destroy() {

    }
}
